var request = require('supertest');
var chai = require('chai');
var should = chai.should();
var assert = chai.assert;

var Project = require('./../models/Project');
var prj = null;

before(function(done) {
    prj = new Project(523);
    prj.prjName = "测试项目不要回复";
    done();
});




describe('#getReviewerList 测试', function() {
    it('应该能够获取到该用户的审核人', function(done) {
        this.timeout(8000);
        prj.getReviewerList().then(function(data) {
            console.log(data);
            assert(data.length > 0, true);
            done();
        });
    })
});

describe('#发送邮件的测试', function() {
    it.only('应该能够把邮件发送到每一个审核人', function(done) {
        this.timeout(800000);
        var handler = require('./../activity/handler/newDataUpload.js');
        handler({
            prjId: 428,
            prjName: '测试项目不要回复',
            date: '2015-1-1',
            notify: 1
        }).then(function(arguments) {
            setTimeout(function() {
                // body...
                done();
            }, 4000);
        })
    })
});


describe('#统计未审核的观测数据信息', function() {
    it('应该能够把未审核过的数据信息统计进数据库,按照:时间,监测类型,监测位置', function(done) {
        this.timeout(8000);
        prj._triggerUnReviewedMontinorInfo({
            prjId: 44,
            date: '2013-1-1'
        }).then(function(data) {
            assert(data.length > 0, true);
            done();
        })
    })
});
